/**
 * Decision Tree that main task is to interact between C++ faif library and Python.
 * From Python we have all functions to operate on DTC
 */
#pragma once

#include <boost/python.hpp>
#include <boost/python/class.hpp>
#include "boost/python/detail/wrap_python.hpp"
#include <faif/learning/DecisionTree.hpp>
#include "typedefs.hpp"

using namespace std;
using namespace boost::python;

template<typename V>
class ZPRDecisionTreeTemplate {
    public:

        ZPRDecisionTreeTemplate() {}

        typedef faif::ml::DecisionTree<V> DTC_;
        typedef class_<DTC_> class_dtc_;

        void zprPassDomain(boost::python::object domain_name,  boost::python::object domain);
        void zprPassAttributeDomain(boost::python::object attributeDomain);
        void zprPassAttributeDomainWithName(boost::python::object category_name, boost::python::object attributeDomain);
        void zprPassTrainExamples(boost::python::object trainExamples, boost::python::object trainCategory);
        void zprPassTestExample(boost::python::object testExamples);
		void applyTree();
		void zprTrain();
        void zprReset();

        object zprGetCategoryDomainFromDTC();
		object zprGetAttrDomainsFromDTC();
		object zprGetCategoryFromDTC(object o);
		object zprGetCategoryIddFromDTC(object o);
        object zprGetCategoriesFromDTC(object o);

        void zprSetParamToDTC(object o);

        static void wrap(const std::string& python_name);

    private:
        DTC*    pointerToDecisionTree_;

		ZprDomains domains_;
		ZprAttrDomain attrDomain_;
		ZprExamplesTrain examples_;
		ZprExampleTest tests_;

		bool haveAttrDomain_;
		bool newDomains_;

        faif::ml::DecisionTreeTrainParam param_;
 };

 #include "zprDecisionTreeTemplate_impl.hpp"


